package com.baway.cache


import com.bawei.lib_cache.acache.KVCache
import com.bawei.lib_cache.datastore.KVDataStore
import com.bawei.lib_cache.lru.KVLruCache
import com.bawei.lib_cache.mmkv.KVmmkvCache
import com.bawei.lib_cache.sp.KVSpCache

/**
 * 对外提供统一工具方法
 */
object KVCacheUtil {

    /**
     * 根据不同的缓存策略获取不同实现
     */
    fun getKvCache(strategy: CacheStrategy): ICache{
        return when(strategy){
            CacheStrategy.A_CACHE -> KVCache
            CacheStrategy.LRU_CACHE -> KVLruCache
            CacheStrategy.SP_CACHE -> KVSpCache
            CacheStrategy.DATA_STORE -> KVDataStore
            CacheStrategy.MMKV_CACHE -> KVmmkvCache
        }
    }

}